package cn.com.nes.mybatis.agent.ope.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * <p>
 * 设备协议控制指令表
 * </p>
 *
 * @author nes
 * @since 2023-03-07
 */
@TableName("is_protocol_control_command")
public class IsProtocolControlCommand extends Model<IsProtocolControlCommand> {

    private static final long serialVersionUID = 1L;

    /**
     * 自增id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 控制指令id
     */
    @TableField("control_command_id")
    private String controlCommandId;
    /**
     * 设备协议id
     */
    @TableField("protocol_id")
    private String protocolId;
    /**
     * 指令标题
     */
    private String name;
    /**
     * 指令
     */
    private String command;
    /**
     * 控制值长度
     */
    @TableField("value_length")
    private Integer valueLength;
    /**
     * 控制值转换方式id
d_type_12
     */
    @TableField("control_convert_id")
    private Integer controlConvertId;
    /**
     * 返回数据的头部
     */
    @TableField("response_header")
    private String responseHeader;
    /**
     * 返回数据的长度
     */
    @TableField("response_length")
    private Integer responseLength;
    /**
     * 数据转换方式计算公式
     */
    private String formula;
    /**
     * 逻辑删除  1 表示删除，0 表示未删除
     */
    @TableField("is_deleted")
    private Integer isDeleted;
    /**
     * 创建人
     */
    @TableField("cr_oper")
    private String crOper;
    /**
     * 创建时间
     */
    @TableField("gmt_create")
    private Date gmtCreate;
    /**
     * 修改人
     */
    @TableField("up_oper")
    private String upOper;
    /**
     * 修改时间
     */
    @TableField("gmt_modified")
    private Date gmtModified;
    /**
     * 数据版本号  当前时间戳
     */
    private Long version;
    /**
     * 控制对应的数据项id, 多个用英文逗号隔开
     */
    @TableField(value = "relation_data_item_ids")
    private String relationDataItemIds;
    /**
     * 是否查询最新运行情况 0-否; 1-是
d_type_72
     */
    @TableField("is_query_data")
    private Integer isQueryData;
    /**
     * 控制项bit位
     */
    @TableField(value = "control_bit_place")
    private Integer controlBitPlace;
    /**
     * 控制位bit位截止位
     */
    @TableField(value = "control_bit_place_end")
    private Integer controlBitPlaceEnd;
    /**
     * 节点地址
     */
    private String nodeid;
    /**
     * 分组类型 1-布尔类型;2-下拉选择类型;3-数值类型
     */
    @TableField("group_type")
    private String groupType;
    /**
     * PLC设备id
     */
    @TableField("plc_sb_id")
    private String plcSbId;
    /**
     * PLC设备名称
     */
    @TableField("plc_sb_name")
    private String plcSbName;
    /**
     * 反控查询项
     */
    @TableField("control_data")
    private String controlData;
    /**
     * 控制值替换函数
     */
    private String replacement;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getControlCommandId() {
        return controlCommandId;
    }

    public void setControlCommandId(String controlCommandId) {
        this.controlCommandId = controlCommandId;
    }

    public String getProtocolId() {
        return protocolId;
    }

    public void setProtocolId(String protocolId) {
        this.protocolId = protocolId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCommand() {
        return command;
    }

    public void setCommand(String command) {
        this.command = command;
    }

    public Integer getValueLength() {
        return valueLength;
    }

    public void setValueLength(Integer valueLength) {
        this.valueLength = valueLength;
    }

    public Integer getControlConvertId() {
        return controlConvertId;
    }

    public void setControlConvertId(Integer controlConvertId) {
        this.controlConvertId = controlConvertId;
    }

    public String getResponseHeader() {
        return responseHeader;
    }

    public void setResponseHeader(String responseHeader) {
        this.responseHeader = responseHeader;
    }

    public Integer getResponseLength() {
        return responseLength;
    }

    public void setResponseLength(Integer responseLength) {
        this.responseLength = responseLength;
    }

    public String getFormula() {
        return formula;
    }

    public void setFormula(String formula) {
        this.formula = formula;
    }

    public Integer getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }

    public String getCrOper() {
        return crOper;
    }

    public void setCrOper(String crOper) {
        this.crOper = crOper;
    }

    public Date getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(Date gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public String getUpOper() {
        return upOper;
    }

    public void setUpOper(String upOper) {
        this.upOper = upOper;
    }

    public Date getGmtModified() {
        return gmtModified;
    }

    public void setGmtModified(Date gmtModified) {
        this.gmtModified = gmtModified;
    }

    public Long getVersion() {
        return version;
    }

    public void setVersion(Long version) {
        this.version = version;
    }

    public String getRelationDataItemIds() {
        return relationDataItemIds;
    }

    public void setRelationDataItemIds(String relationDataItemIds) {
        this.relationDataItemIds = relationDataItemIds;
    }

    public Integer getIsQueryData() {
        return isQueryData;
    }

    public void setIsQueryData(Integer isQueryData) {
        this.isQueryData = isQueryData;
    }

    public Integer getControlBitPlace() {
        return controlBitPlace;
    }

    public void setControlBitPlace(Integer controlBitPlace) {
        this.controlBitPlace = controlBitPlace;
    }

    public Integer getControlBitPlaceEnd() {
        return controlBitPlaceEnd;
    }

    public void setControlBitPlaceEnd(Integer controlBitPlaceEnd) {
        this.controlBitPlaceEnd = controlBitPlaceEnd;
    }

    public String getNodeid() {
        return nodeid;
    }

    public void setNodeid(String nodeid) {
        this.nodeid = nodeid;
    }

    public String getGroupType() {
        return groupType;
    }

    public void setGroupType(String groupType) {
        this.groupType = groupType;
    }

    public String getPlcSbId() {
        return plcSbId;
    }

    public void setPlcSbId(String plcSbId) {
        this.plcSbId = plcSbId;
    }

    public String getPlcSbName() {
        return plcSbName;
    }

    public void setPlcSbName(String plcSbName) {
        this.plcSbName = plcSbName;
    }

    public String getControlData() {
        return controlData;
    }

    public void setControlData(String controlData) {
        this.controlData = controlData;
    }

    public String getReplacement() {
        return replacement;
    }

    public void setReplacement(String replacement) {
        this.replacement = replacement;
    }

    public static final String ID = "id";

    public static final String CONTROL_COMMAND_ID = "control_command_id";

    public static final String PROTOCOL_ID = "protocol_id";

    public static final String NAME = "name";

    public static final String COMMAND = "command";

    public static final String VALUE_LENGTH = "value_length";

    public static final String CONTROL_CONVERT_ID = "control_convert_id";

    public static final String RESPONSE_HEADER = "response_header";

    public static final String RESPONSE_LENGTH = "response_length";

    public static final String FORMULA = "formula";

    public static final String IS_DELETED = "is_deleted";

    public static final String CR_OPER = "cr_oper";

    public static final String GMT_CREATE = "gmt_create";

    public static final String UP_OPER = "up_oper";

    public static final String GMT_MODIFIED = "gmt_modified";

    public static final String VERSION = "version";

    public static final String RELATION_DATA_ITEM_IDS = "relation_data_item_ids";

    public static final String IS_QUERY_DATA = "is_query_data";

    public static final String CONTROL_BIT_PLACE = "control_bit_place";

    public static final String CONTROL_BIT_PLACE_END = "control_bit_place_end";

    public static final String NODEID = "nodeid";

    public static final String GROUP_TYPE = "group_type";

    public static final String PLC_SB_ID = "plc_sb_id";

    public static final String PLC_SB_NAME = "plc_sb_name";

    public static final String CONTROL_DATA = "control_data";

    public static final String REPLACEMENT = "replacement";

    @Override
    public Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "IsProtocolControlCommand{" +
        ", id=" + id +
        ", controlCommandId=" + controlCommandId +
        ", protocolId=" + protocolId +
        ", name=" + name +
        ", command=" + command +
        ", valueLength=" + valueLength +
        ", controlConvertId=" + controlConvertId +
        ", responseHeader=" + responseHeader +
        ", responseLength=" + responseLength +
        ", formula=" + formula +
        ", isDeleted=" + isDeleted +
        ", crOper=" + crOper +
        ", gmtCreate=" + gmtCreate +
        ", upOper=" + upOper +
        ", gmtModified=" + gmtModified +
        ", version=" + version +
        ", relationDataItemIds=" + relationDataItemIds +
        ", isQueryData=" + isQueryData +
        ", controlBitPlace=" + controlBitPlace +
        ", controlBitPlaceEnd=" + controlBitPlaceEnd +
        ", nodeid=" + nodeid +
        ", groupType=" + groupType +
        ", plcSbId=" + plcSbId +
        ", plcSbName=" + plcSbName +
        ", controlData=" + controlData +
        ", replacement=" + replacement +
        "}";
    }

    @Override
    public int hashCode() {
        return Objects.hash(this.controlCommandId);
    }
}
